package tool

type R struct {
	Code int         `json:"code"`
	Msg  string      `json:"msg"`
	Data interface{} `json:"data"`
}

func Response(code int, msg string, data interface{}) R {
	return R{
		code,
		msg,
		data,
	}
}
func Success(msg string, data interface{}) R {
	return R{
		Code: 200,
		Msg:  msg,
		Data: data,
	}
}
func Error(msg string, data interface{}) R {

	return R{
		Code: 500,
		Msg:  msg,
		Data: data,
	}
}
